/**
 * ElementFactory.java
 * @authors: Connor Gordon, Difan Zhao, Kathleen Lan, Patrick Royal
 */

package model;

import io.DataParser;
import io.ParserManager;


/**
 * Generates elements from a file.
 * 
 * @author Group 8
 * 
 */
public final class ElementFactory {

    private ElementFactory() {
    }
    /**
     * Loads a new file into the list.
     * 
     * @param a list into which the element will go
     * @param name name of the element
     * @param id unique identification string for the element
     * @param url web address of the file in which the element resides
     * @param ext extension of the filetype 
     */
    public static void loadNewElement (ElementManager a, String name, String id,
            String url, String ext) {
        DataParser p;
        p = ParserManager.selectParser(ext, name, id, url);
        a.addElement(p.parseData());
    }
}
